// Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
#include <sycl/sycl.hpp>
#include "relu7_tiling_data.h"

using namespace sycl;
using namespace sycl::access;
template <typename T> using LocalAccessor = accessor<T, 1, mode::read_write, target::local>;


template <typename T, typename kernel_name>
void kernel_relu(queue &Q, const T *in, T *out, optiling::Relu7TilingData *tilingData, int num_cores)
{
    Q.launch<kernel_name>(num_cores, [in, out, tilingData](group<1> group) {
        // todo
    });
}

int main()
{
    queue Q(default_selector{});
    size_t len = 1000000;
    std::vector<int> input(len);
    int *gmX = malloc_device<int>(len, Q);
    Q.memcpy(gmX, input.data(), len * sizeof(int));
    int *gmY = malloc_device<int>(len, Q);
    optiling::Relu7TilingData data;
    // todo set data
    optiling::Relu7TilingData *gmTilingData = malloc_device<optiling::Relu7TilingData>(1, Q);
    Q.memcpy(gmTilingData, &data, sizeof(optiling::Relu7TilingData));
    int num_cores = 32;
    kernel_relu<int, class Relu7KernelName>(Q, gmX, gmY, gmTilingData, num_cores);

    std::vector<int> output(len, -1);
    Q.memcpy(output.data(), gmY, len * sizeof(int));

    Q.wait();
}